home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Video.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.6 KB  |  189 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Sunday, September 15, 1991 at 9:30 PM
  5.  Video.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1986-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __VIDEO__
  16. #define __VIDEO__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  mBaseOffset = 1,            /*Id of mBaseOffset.*/
  26.  mRowBytes = 2,                /*Video sResource parameter Id's */
  27.  mBounds = 3,                /*Video sResource parameter Id's */
  28.  mVersion = 4,                /*Video sResource parameter Id's */
  29.  mHRes = 5,                    /*Video sResource parameter Id's */
  30.  mVRes = 6,                    /*Video sResource parameter Id's */
  31.  mPixelType = 7,            /*Video sResource parameter Id's */
  32.  mPixelSize = 8,            /*Video sResource parameter Id's */
  33.  mCmpCount = 9,                /*Video sResource parameter Id's */
  34.  mCmpSize = 10,                /*Video sResource parameter Id's */
  35.  mPlaneBytes = 11,            /*Video sResource parameter Id's */
  36.  mVertRefRate = 14,            /*Video sResource parameter Id's */
  37.  mVidParams = 1,            /*Video parameter block id.*/
  38.  mTable = 2,                /*Offset to the table.*/
  39.  mPageCnt = 3,                /*Number of pages*/
  40.  mDevType = 4,                /*Device Type*/
  41.  
  42.  oneBitMode = 128,            /*Id of OneBitMode Parameter list.*/
  43.  twoBitMode = 129,            /*Id of TwoBitMode Parameter list.*/
  44.  fourBitMode = 130,            /*Id of FourBitMode Parameter list.*/
  45.  eightBitMode = 131            /*Id of EightBitMode Parameter list.*/
  46. };
  47. enum {
  48.  sixteenBitMode = 132,        /*Id of SixteenBitMode Parameter list.*/
  49.  thirtyTwoBitMode = 133,    /*Id of ThirtyTwoBitMode Parameter list.*/
  50.  
  51.  firstVidMode = 128,        /*The new, better way to do the above. */
  52.  secondVidMode = 129,        /* QuickDraw only supports six video */
  53.  thirdVidMode = 130,        /* at this time.      */
  54.  fourthVidMode = 131,
  55.  fifthVidMode = 132,
  56.  sixthVidMode = 133,
  57.  
  58.  spGammaDir = 64,
  59.  spVidNamesDir = 65,
  60.  
  61. /* Control Codes */
  62.  cscReset = 0,
  63.  cscKillIO = 1,
  64.  cscSetMode = 2,
  65.  cscSetEntries = 3,
  66.  cscSetGamma = 4,
  67.  cscGrayPage = 5,
  68.  cscGrayScreen = 5,
  69.  cscSetGray = 6,
  70.  cscSetInterrupt = 7,
  71.  cscDirectSetEntries = 8
  72. };
  73. enum {
  74.  cscSetDefaultMode = 9,
  75.  
  76. /* Status Codes */
  77.  cscGetMode = 2,
  78.  cscGetEntries = 3,
  79.  cscGetPageCnt = 4,
  80.  cscGetPages = 4,            /* This is what C&D 2 calls it. */
  81.  cscGetPageBase = 5,
  82.  cscGetBaseAddr = 5,        /* This is what C&D 2 calls it. */
  83.  cscGetGray = 6,
  84.  cscGetInterrupt = 7,
  85.  cscGetGamma = 8,
  86.  cscGetDefaultMode = 9
  87. };
  88.  
  89. struct VPBlock {
  90.  long vpBaseOffset;            /*Offset to page zero of video RAM (From minorBaseOS).*/
  91.  short vpRowBytes;            /*Width of each row of video memory.*/
  92.  Rect vpBounds;                /*BoundsRect for the video display (gives dimensions).*/
  93.  short vpVersion;            /*PixelMap version number.*/
  94.  short vpPackType;
  95.  long vpPackSize;
  96.  long vpHRes;                /*Horizontal resolution of the device (pixels per inch).*/
  97.  long vpVRes;                /*Vertical resolution of the device (pixels per inch).*/
  98.  short vpPixelType;            /*Defines the pixel type.*/
  99.  short vpPixelSize;            /*Number of bits in pixel.*/
  100.  short vpCmpCount;            /*Number of components in pixel.*/
  101.  short vpCmpSize;            /*Number of bits per component*/
  102.  long vpPlaneBytes;            /*Offset from one plane to the next.*/
  103. };
  104.  
  105. typedef struct VPBlock VPBlock;
  106. typedef VPBlock *VPBlockPtr;
  107.  
  108. struct VDEntryRecord {
  109.  Ptr csTable;                /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  110. };
  111.  
  112. typedef struct VDEntryRecord VDEntryRecord;
  113. typedef VDEntryRecord *VDEntRecPtr;
  114.  
  115. /* Parm block for SetGray control call */
  116. struct VDGrayRecord {
  117.  Boolean csMode;            /*Same as GDDevType value (0=mono, 1=color)*/
  118. };
  119.  
  120. typedef struct VDGrayRecord VDGrayRecord;
  121. typedef VDGrayRecord *VDGrayPtr;
  122.  
  123. /* Parm block for SetEntries control call */
  124. struct VDSetEntryRecord {
  125.  ColorSpec *csTable;        /*Pointer to an array of color specs*/
  126.  short csStart;                /*Which spec in array to start with, or -1*/
  127.  short csCount;                /*Number of color spec entries to set*/
  128. };
  129.  
  130. typedef struct VDSetEntryRecord VDSetEntryRecord;
  131. typedef VDSetEntryRecord *VDSetEntryPtr;
  132.  
  133. /* Parm block for SetGamma control call */
  134. struct VDGammaRecord {
  135.  Ptr csGTable;                /*pointer to gamma table*/
  136. };
  137.  
  138. typedef struct VDGammaRecord VDGammaRecord;
  139. typedef VDGammaRecord *VDGamRecPtr;
  140.  
  141. struct VDPageInfo {
  142.  short csMode;                /*(word) mode within device*/
  143.  long csData;                /*(long) data supplied by driver*/
  144.  short csPage;                /*(word) page to switch in*/
  145.  Ptr csBaseAddr;            /*(long) base address of page*/
  146. };
  147.  
  148. typedef struct VDPageInfo VDPageInfo;
  149. typedef VDPageInfo *VDPgInfoPtr;
  150.  
  151. struct VDSizeInfo {
  152.  short csHSize;                /*(word) desired/returned h size*/
  153.  short csHPos;                /*(word) desired/returned h position*/
  154.  short csVSize;                /*(word) desired/returned v size*/
  155.  short csVPos;                /*(word) desired/returned v position*/
  156. };
  157.  
  158. typedef struct VDSizeInfo VDSizeInfo;
  159. typedef VDSizeInfo *VDSzInfoPtr;
  160.  
  161. struct VDSettings {
  162.  short csParamCnt;            /*(word) number of params*/
  163.  short csBrightMax;            /*(word) max brightness*/
  164.  short csBrightDef;            /*(word) default brightness*/
  165.  short csBrightVal;            /*(word) current brightness*/
  166.  short csCntrstMax;            /*(word) max contrast*/
  167.  short csCntrstDef;            /*(word) default contrast*/
  168.  short csCntrstVal;            /*(word) current contrast*/
  169.  short csTintMax;            /*(word) max tint*/
  170.  short csTintDef;            /*(word) default tint*/
  171.  short csTintVal;            /*(word) current tint*/
  172.  short csHueMax;            /*(word) max hue*/
  173.  short csHueDef;            /*(word) default hue*/
  174.  short csHueVal;            /*(word) current hue*/
  175.  short csHorizDef;            /*(word) default horizontal*/
  176.  short csHorizVal;            /*(word) current horizontal*/
  177.  short csHorizMax;            /*(word) max horizontal*/
  178.  short csVertDef;            /*(word) default vertical*/
  179.  short csVertVal;            /*(word) current vertical*/
  180.  short csVertMax;            /*(word) max vertical*/
  181. };
  182.  
  183. typedef struct VDSettings VDSettings;
  184. typedef VDSettings *VDSettingsPtr;
  185.  
  186.  
  187.  
  188. #endif
  189.